package com.le.tester.javaThink.fifth.chapter18_Str;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * createTime：2021/8/13 16:24
 * description：匹配的Flags
 */
public class ReFlags {
    public static void main(String[] args) {
        Pattern pattern = Pattern.compile("^java",
                Pattern.CASE_INSENSITIVE | Pattern.MULTILINE);
        Matcher matcher = pattern.matcher("java has regex\nJava has regex\n" +
                "JAVA has pretty good regular expressions\n" +
                "Regular expressions are in Java");

        while (matcher.find())
            System.out.println(matcher.group());
    }
}
